package cadc.ping;

import cadc.actions.UserAction;
import cadc.daos.PingDao;

@SuppressWarnings("serial")
public class UpdatePing extends UserAction {
	private String columnName;
	private String columnValue;
	private PingDao pingDao;
	private int groupId;
	private String label;

	public String execute(){
			if(pingDao.updatePing(columnName, columnValue, groupId, (int) super.getAccount().getId())){
				if(label==null)label=columnValue;
				return SUCCESS;
			}else return ERROR;
	}

	public String getColumnName() {
		return columnName;
	}

	public void setColumnName(String columnName) {
		this.columnName = columnName;
	}

	public String getColumnValue() {
		return columnValue;
	}

	public void setColumnValue(String columnValue) {
		this.columnValue = columnValue;
	}

	public PingDao getPingDao() {
		return pingDao;
	}

	public void setPingDao(PingDao pingDao) {
		this.pingDao = pingDao;
	}

	public int getGroupId() {
		return groupId;
	}

	public void setGroupId(int groupId) {
		this.groupId = groupId;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}
}
